package com.finley.flowabledemo.design.responsibility;

import cn.hutool.core.util.StrUtil;

/**
 * @description: 经理级别
 * @author: xianfei.chao
 * @date 2025/5/31 22:00
 * @version: 1.0
 */
public class CommonManager extends Manager {

    public CommonManager(String name) {
        super(name);
    }

    @Override
    public void requestApplications(Request request) {
        if ("请假".equals(request.getRequestType()) && request.getNumber() <= 5) {
            System.out.println(StrUtil.format("{}:{}数量:{}被批准",
                    name, request.getRequestType(), request.getNumber()));
            return;
        }

        if (superior != null) {
            superior.requestApplications(request);
        }
    }
}
